package com.glodon.paas.account.api.sso.web;

import javax.servlet.http.HttpSession;

/**
 * A registry to store the authenticated sessions
 *
 * @author Don Li
 */
public interface AuthenticatedSessionRegistry {
    /**
     * Invalidate all the sessions belong to the user
     *
     * @param id user id
     */
    void invalidateUserSessions(String id);

    /**
     * @param id      user id
     * @param session http session
     */
    void addSession(String id, HttpSession session);

    /**
     * @param id      user id
     * @param session http session
     */
    void removeSession(String id, HttpSession session);
}
